package com.yuyou.fn.tms.vo;

import com.yuyou.fn.educational.entity.Campus;
import com.yuyou.fn.platform.entity.City;
import com.yuyou.fn.platform.entity.District;
import com.yuyou.fn.platform.entity.Province;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * Created by lzh on 2019/1/24.
 */
public class TmsCampus {
    @ApiModelProperty("分校id")
    private Long deptId ;//分校id

    @ApiModelProperty("分校名称")
    private String deptName ;//分校名称

    @ApiModelProperty("所属省份ID")
    private Long proId ;//所属省份ID

    @ApiModelProperty("所属省份")
    private String proName ;//所属省份

    @ApiModelProperty("城市id")
    private Long cityId ;//城市id

    @ApiModelProperty("城市名称")
    private String cityName ;//城市名称

    @ApiModelProperty("管理区域id")
    private Long masId ;//管理区域id

    @ApiModelProperty("管理区域名称")
    private String masName ;//管理区域名称

    @ApiModelProperty("分校电话")
    private String deptCampusTel ;//分校电话

    @ApiModelProperty("分校地址")
    private String deptAddr ;//分校地址

    @ApiModelProperty("财务主体Id")
    private Long fgcId ;//财务主体Id

    @ApiModelProperty("财务主体名称")
    private String fgcName ;//财务主体名称

    @ApiModelProperty("地理经度")
    private String deptLng ;//地理经度

    @ApiModelProperty("地理纬度")
    private String deptLat ;//地理纬度

    @ApiModelProperty("最后修改时间")
    private Date modifyTime ;//最后修改时间

    @ApiModelProperty("是否删除（否：0、是：1）")
    private Integer isDeleted ;//是否删除（否：0、是：1）

    @ApiModelProperty("部门状态（正常：0、停用：1）")
    private Integer status ;//部门状态（正常：0、停用：1）

    public TmsCampus(Campus campus, Province province, City city, District district){
        this.setDeptId(campus.getCampusId());//分校id
        this.setDeptName(campus.getCampusName());//分校名称
        if (province!=null){
            this.setProId(province.getProvinceId());//所属省份ID
            this.setProName(province.getProvinceName());//所属省份
        }
        if (city!=null){
            this.setCityId(city.getCityId());//城市id
            this.setCityName(city.getCityName());//城市名称
        }
        if (district!=null){
            this.setMasId(district.getDistrictId());//管理区域id
            this.setMasName(district.getDistrictName());//管理区域名称
        }
        this.setDeptCampusTel(campus.getPhoneNo());//分校电话
        this.setDeptAddr(campus.getAddress());//分校地址
        this.setFgcId(null);//财务主体Id
        this.setFgcName(null);//财务主体名称
        if (StringUtils.isNotEmpty(campus.getGeoLocation())){
            String[] geoLocations = campus.getGeoLocation().split(" ");
            this.setDeptLng(geoLocations[0]);//地理经度
            this.setDeptLat(geoLocations[1]);//地理纬度
        }

        this.setModifyTime(campus.getUpdateTime());//最后修改时间
        this.setIsDeleted(0);//是否删除（否：0、是：1）
        this.setStatus(0);//部门状态（正常：0、停用：1）
    }
    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public Long getProId() {
        return proId;
    }

    public void setProId(Long proId) {
        this.proId = proId;
    }

    public String getProName() {
        return proName;
    }

    public void setProName(String proName) {
        this.proName = proName;
    }

    public Long getCityId() {
        return cityId;
    }

    public void setCityId(Long cityId) {
        this.cityId = cityId;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public Long getMasId() {
        return masId;
    }

    public void setMasId(Long masId) {
        this.masId = masId;
    }

    public String getMasName() {
        return masName;
    }

    public void setMasName(String masName) {
        this.masName = masName;
    }

    public String getDeptCampusTel() {
        return deptCampusTel;
    }

    public void setDeptCampusTel(String deptCampusTel) {
        this.deptCampusTel = deptCampusTel;
    }

    public String getDeptAddr() {
        return deptAddr;
    }

    public void setDeptAddr(String deptAddr) {
        this.deptAddr = deptAddr;
    }

    public Long getFgcId() {
        return fgcId;
    }

    public void setFgcId(Long fgcId) {
        this.fgcId = fgcId;
    }

    public String getFgcName() {
        return fgcName;
    }

    public void setFgcName(String fgcName) {
        this.fgcName = fgcName;
    }

    public String getDeptLng() {
        return deptLng;
    }

    public void setDeptLng(String deptLng) {
        this.deptLng = deptLng;
    }

    public String getDeptLat() {
        return deptLat;
    }

    public void setDeptLat(String deptLat) {
        this.deptLat = deptLat;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
